@echo off
set port=8181
for /f "tokens=1-5" %%i in ('netstat -ano^|findstr ":%port%"') do (
    echo kill the process %%m who use the port
    taskkill /pid %%m -t -f
    goto START
)
:START

chcp 65001
%1 mshta vbscript:CreateObject("WScript.Shell").Run("%~s0 ::",0,FALSE)(window.close)&&exit
java -Dfile.encoding=utf-8  -jar ./target/cw.jar  >log.log  2>&1 &
exit
